#!/usr/bin/perl
$file_name = "/home/thy/ydjw-tomcat-6.0.36/logs/catalina.out";
@attribute = stat($file_name);
$file_size = $attribute[7];
#print "$file_size\n";
if ($file_size<10126413769)
{
#       print "1111">>/opt/monitor/log_catalina;
#       exec('echo "size of catalina.out is $file_size byte" >>/opt/monitor/log_catalina');
#       exec('echo"===============================" >>/opt/monitor/log_catalina');
#       print "$file_size\n";
        exec("> $file_name");

open (SAVEOUT,">&STDOUT");
open (STDOUT,">>/opt/monitor/log_logined") or die "Can't open log_logined:$!";
print "size of catalina.out is $file_size byte";
system "date";
print "=======================================================\n";
open (STDOUT,">&SAVEOUT");
}
